package com.cuckoo.cuckoo_app2.utils;

import android.content.Context;
import android.content.Intent;

import com.cuckoo.cuckoo_app2.dao.SiteLink;
import com.cuckoo.cuckoo_app2.ui.ChangePasswordAcitvity;
import com.cuckoo.cuckoo_app2.ui.ChangePhoneAcitvity;
import com.cuckoo.cuckoo_app2.ui.MainActivity;
import com.cuckoo.cuckoo_app2.ui.MaskLoginActivity;
import com.cuckoo.cuckoo_app2.ui.MyInvitationActivity;
import com.cuckoo.cuckoo_app2.ui.SystemFeedbackAcitvity;
import com.cuckoo.cuckoo_app2.ui.VipMembershipAcitvity;
import com.cuckoo.cuckoo_app2.ui.WalletActivity;
import com.cuckoo.cuckoo_app2.ui.WebViewActivity;
import com.cuckoo.cuckoo_app2.ui.WithdraAcitity;
import com.google.gson.internal.bind.JsonTreeReader;

public class RouteUtils {

    /**
     * 跳转到主页面
     */
    public static void toMainActivity(Context context) {
        Intent intent = new Intent(context, MainActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

    /**
     * 跳转到登录页面
     *
     * @param context
     */
    public static void toLoginActivity(Context context) {
        Intent intent = new Intent(context, MaskLoginActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

    /**
     * 跳转到wevView页面
     * ID
     */
    public static void toWebViewActivity(Context context, String id, String type) {
        Intent intent = new Intent(context, WebViewActivity.class);
        intent.putExtra("id", id);
        intent.putExtra("type", type);
        context.startActivity(intent);
    }

    /**
     * 跳转到修改密码页面
     */
    public static void toChangePasswordActivity(Context context) {
        Intent intent = new Intent(context, ChangePasswordAcitvity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转到修改手机号页面
     */
    public static void toChangePhoneActivity(Context context) {
        Intent intent = new Intent(context, ChangePhoneAcitvity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转到系统反馈页面
     */
    public static void toSystemFeedbackActivity(Context context) {
        Intent intent = new Intent(context, SystemFeedbackAcitvity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转到vip列表页
     */
    public static void toVipMembershipAcitvity(Context context) {
        Intent intent = new Intent(context, VipMembershipAcitvity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转到要求页面
     */
    public static void toMyInvitationActivity(Context context) {
        Intent intent = new Intent(context, MyInvitationActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转到钱包
     */
    public static void toWalletActivity(Context context) {
        Intent intent = new Intent(context, WalletActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转提现页面
     */
    public static void toWithdrawActivity(Context context) {
        Intent intent = new Intent(context, WithdraAcitity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转添加平台
     *
     * @param context
     */
    public static void toAddPlatformActivity(Context context) {
        Intent intent = new Intent(context, com.cuckoo.cuckoo_app2.ui.AddPlatformActivity.class);
        context.startActivity(intent);
    }

    /**
     * 跳转到平台登录页面
     */
    public static void toPlatformLoginActivity(Context context, String id) {
        Intent intent = new Intent(context, com.cuckoo.cuckoo_app2.ui.LoginWebActivity.class);
        intent.putExtra("id", id);
        context.startActivity(intent);
    }


    // 示例：带有额外参数的跳转
//    public static void toDetailActivity(Context context, String data) {
//        Intent intent = new Intent(context, DetailActivity.class);
//        intent.putExtra("key", data);
//        context.startActivity(intent);
//    }

    // 示例：跳转并关闭当前页面
//    public static void toMainActivityAndClear(Context context) {
//        Intent intent = new Intent(context, MainActivity.class);
//        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
//        context.startActivity(intent);
//    }
}
